package enron;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.XYPlot;
import org.jfree.data.time.DynamicTimeSeriesCollection;

public class ChartGUITemplate extends ChartPanel {
	private static final long serialVersionUID = -860571897341470762L;

	/**
	 * Create the panel.
	 */
	public ChartGUITemplate(String chartTitle) {
        super(createChart(createDataset(), chartTitle));
        this.setPreferredSize(new java.awt.Dimension(500, 270));
	}
	
	private static DynamicTimeSeriesCollection createDataset() {
		DynamicTimeSeriesCollection result = new DynamicTimeSeriesCollection(0,0);
        return result;
        
    }

    private static JFreeChart createChart(DynamicTimeSeriesCollection dynamicTimeSeriesCollection, String title) {
        
        JFreeChart chart = ChartFactory.createXYLineChart(title, "X Axis", "Y Axis", dynamicTimeSeriesCollection, PlotOrientation.HORIZONTAL, false, false, false);
        XYPlot plot = (XYPlot) chart.getPlot();
        plot.setForegroundAlpha(0.5f);
        plot.setBackgroundAlpha(1.0f);
        return chart;
        
    }

}
